<%@taglib prefix="in" uri="/WEB-INF/TagDescriptor.tld"%><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<in:pHeader />
<link rel="stylesheet" type="text/css" href="includes/css/style.css" />
<script type="text/javascript" src="includes/js/jquery/global.js"></script>
<script type="text/javascript">
	function showWindow() {
		var market = "";
		var projectType = "";
		var portfolio = "";
		var portfolioName = "";

		var node = $("#market").combotree('tree').tree('getSelected');
		if (node) {
			market = node.id;

		}

		node = $("#projectType").combotree('tree').tree('getSelected');
		if (node) {
			projectType = node.id;

		}
		node = $("#portfolio").combotree('tree').tree('getSelected');
		if (node) {
			portfolio = node.id;
			portfolioName = node.text;

		}

		if (market == "" || projectType == "" || portfolio == "") {
			showMessager("Error", "Please select required fields");
			return false;
		}
		var userid = $("#userId").val();
		var url = "AddOpportunity.htm?market=" + market + "&projectType="
				+ projectType + "&portfolio=" + portfolio + "&userId=" + userid
				+ "&portfolioName=" + portfolioName;
		window.open(url, "popupWindow",
				"width=880,height=750,scrollbars=yes,location=no,menubar=no");
		return false;
	}
</script>
</head>
<body style="margin: 0px;">
	<div class="formBody" style="width: 100%; font-size: 11px">
		<input type="hidden" id="userId" value="${userId}">
		<table class="homeTbl">
			<tr>
				<td colspan="2"><span style="color: #8F5700; font-size: 14px"><b>Register
							New Opportunity</b></span></td>
			</tr>
			<tr>
				<td colspan="2">Register any new opportunity for review by
					Portfolio Review Committee. Proposal/Bid will be prepared only for
					opportunities approved by Portfolio Review Committee.</td>
			</tr>
			<tr>
				<td colspan="2">Select market and project type and register
					opportunities.</td>
			</tr>
			<tr>
				<td><b>Market:</b></td>
				<td><input class="easyui-combotree"
					data-options="url:'loadProjectCode.htm?code=${market}',method:'get',required:true"
					style="width: 200px;" id="market"></td>
			</tr>
			<tr>
				<td><b>Project Type:</b></td>
				<td><input class="easyui-combotree"
					data-options="url:'loadProjectCode.htm?code=${projectType}',method:'get',required:true"
					style="width: 200px;" id="projectType"></input></td>
			</tr>
			<tr>
				<td><b>Portfolio:</b></td>
				<td><input class="easyui-combotree"
					data-options="url:'loadProjectCode.htm?code=${portfolio}',method:'get',required:true"
					style="width: 200px;" id="portfolio"></td>
			</tr>
			<tr>
				<td colspan="2"><a id="repBtn" href="#" onClick="showWindow();"
					class="easyui-linkbutton">Register</a></td>
			</tr>
		</table>
	</div>
</body>
</html>